/*
+----------------------------------------------------------------------+
| MD                                                              |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license,    |
| that is bundled with this package in the file LICENSE, and is        |
| available through the world-wide-web at the following url:           |
| http://www.apache.org/licenses/LICENSE-2.0.html                      |
| If you did not receive a copy of the Apache2.0 license and are unable|
| to obtain it through the world-wide-web, please send a note to       |
| license@php.net so we can mail you a copy immediately.               |
+----------------------------------------------------------------------+
| Author: vb2005xu  <vb2005xu@qq.com>                                  |
+----------------------------------------------------------------------+
*/


#ifndef PHP_MD_H
#define PHP_MD_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "include/md.h"

extern zend_module_entry md_module_entry;
#define phpext_md_ptr &md_module_entry

#ifdef PHP_WIN32
# define PHP_MD_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_MD_API __attribute__ ((visibility("default")))
#else
# define PHP_MD_API
#endif

#ifdef ZTS
#include "TSRM.h"
#define MD_G(v) TSRMG(md_globals_id, zend_md_globals *, v)
#else
#define MD_G(v) (md_globals.v)
#endif


#ifndef E_EXCEPTION
# define E_EXCEPTION (1<<15L)
#endif

// 初始化module时运行
PHP_MINIT_FUNCTION(md);
//当module被卸载时运行
PHP_MSHUTDOWN_FUNCTION(md);
//当一个REQUEST请求初始化时运行
PHP_RINIT_FUNCTION(md); 
//当一个REQUEST请求结束时运行
PHP_RSHUTDOWN_FUNCTION(md);
// 设置phpinfo中此模块展示的信息
PHP_MINFO_FUNCTION(md);


ZEND_BEGIN_MODULE_GLOBALS(md)
	
	// 定义一个变量
	zend_bool retype;

ZEND_END_MODULE_GLOBALS(md)


PHP_FUNCTION(md_confirm_compiled);
PHP_FUNCTION(md_get_version);
PHP_FUNCTION(md_get_author);
PHP_FUNCTION(md_get_markdownhelp);

// 大标题
PHP_FUNCTION(md_title);
// 副标题
// PHP_FUNCTION(md_subtitle);
// 章标题
PHP_FUNCTION(md_chapter_title);
// 节标题 1.1
PHP_FUNCTION(md_section_title);
// 条标题 1.1.1
PHP_FUNCTION(md_section_subtitle);
// 目录区
PHP_FUNCTION(md_catalog_start);
PHP_FUNCTION(md_catalog_end);
// 分隔线
PHP_FUNCTION(md_ruler);
// 段落
PHP_FUNCTION(md_paragraph);
// 引用
PHP_FUNCTION(md_blockquote);
// 范例
PHP_FUNCTION(md_code_start);
PHP_FUNCTION(md_code_end);
// 插图
PHP_FUNCTION(md_img);
// 链接
PHP_FUNCTION(md_link);
// 表格
// 列表项
// 任务项
// 斜体
// 粗体





BEGIN_EXTERN_C()

PHPAPI int md_print(const char *str);
PHPAPI int md_printf(const char *fmt, ...);
PHPAPI int md_println(const char *str);
PHPAPI int md_nullLines(int num_lines);

END_EXTERN_C()

#endif /* PHP_MD_H */